﻿using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using WalkingTec.Mvvm.Core;
using System.Text.Json.Serialization;
using Digitalmes.Model;
using Digitalmes.Model.AndonManagement;

namespace Digitalmes.Model.AndonManagement
{
    /// <summary>
    /// 站点负责人
    /// </summary>
	[Table("AndonStationHeader")]

    [Display(Name = "_Model.AndonStationHeader")]
    public class AndonStationHeader : BasePoco,IPersistPoco,ITenant
    {
        [Key]
        [Display(Name = "_Model._AndonStationHeader._ID")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public new long ID { get; set; }
        [Display(Name = "_Model._AndonStationHeader._Station")]
        [Comment("关联站点")]
        public AndonStation Station { get; set; }
        [Display(Name = "_Model._AndonStationHeader._Station")]
        [Comment("关联站点")]
        public long? StationId { get; set; }
        [Display(Name = "_Model._AndonStationHeader._HeaderRole")]
        [Comment("职位")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public string HeaderRole { get; set; }
        [Display(Name = "_Model._AndonStationHeader._Header")]
        [Comment("负责人")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public string Header { get; set; }
        [Display(Name = "_Model._AndonStationHeader._ContactNumber")]
        [Comment("联系电话")]
        [Required(ErrorMessage = "Validate.{0}required")]
        [RegularExpression("^[1][3456789][0-9]{9}$", ErrorMessage = "Validate.{0}formaterror")]
        public string ContactNumber { get; set; }
        [Display(Name = "_Model._AndonStationHeader._IsValid")]
        [Comment("是否有效")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public bool IsValid { get; set; } = true;
        [StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
        public string TenantCode { get; set; }

	}

}
